Bacterial 16S

Base Data Read-in

Reading in Data

Metadata

OTU Table

Alpha Diversity

Antifungal predictions

Beta Diversity

Merged Metadata, Alpha diversity and Antifungal predictions

Alpha Diversity

Pre/Post Exposure

sOTU richness

#**Data wrangling to calculate change in alpha diversity through time **

AdNewt16S_Meta_Alpha_AntiF_PrePost = AdNewt16S_Meta_Alpha_AntiF %>%
  unite(DosInd, Dose, IndividualID, sep = "_", remove = FALSE) %>%
  select(SampleID,Temperature,TimeWeekCat,Dose,DosInd,observed_features,faith_pd,shannon_entropy,pielou_evenness, ExpShannon,AntiFungal_Richness,AntiFungal_Richness_Bsal,TotalAntiFungal,TotalAntiFungal_Bsal,Prop_AntiFungal_Count,Prop_AntiFungal_Bsal_Count) %>%
  filter(TimeWeekCat == "A" |TimeWeekCat == "B")

AdNewt16S_Meta_Alpha_AntiF_PrePost_6CRich = AdNewt16S_Meta_Alpha_AntiF_PrePost %>%
 filter(Temperature == "6") %>%
  select(Temperature,Dose,TimeWeekCat,DosInd,observed_features) %>%
  pivot_wider(names_from = TimeWeekCat,values_from = observed_features) %>%
  mutate(ChangeAlpha = B-A)

AdNewt16S_Meta_Alpha_AntiF_PrePost_14CRich = AdNewt16S_Meta_Alpha_AntiF_PrePost %>%
 filter(Temperature == "14") %>%
  select(Temperature,Dose,TimeWeekCat,DosInd,observed_features) %>%
  pivot_wider(names_from = TimeWeekCat,values_from = observed_features) %>%
  mutate(ChangeAlpha = B-A)

AdNewt16S_Meta_Alpha_AntiF_PrePost_22CRich = AdNewt16S_Meta_Alpha_AntiF_PrePost %>%
 filter(Temperature == "22") %>%
  select(Temperature,Dose,TimeWeekCat,DosInd,observed_features) %>%
  pivot_wider(names_from = TimeWeekCat,values_from = observed_features) %>%
  mutate(ChangeAlpha = B-A)

PrePost_Rich_Differential<- rbind(AdNewt16S_Meta_Alpha_AntiF_PrePost_6CRich,AdNewt16S_Meta_Alpha_AntiF_PrePost_14CRich,AdNewt16S_Meta_Alpha_AntiF_PrePost_22CRich)

Phylogenetic Diversity

Shannon

Effective species (exp-shannon)

Evenness

Conclusions:

Overall: temperature induced differential responses of skin bacterial alpha diversity after exposure to Bsal

  • at 14 C an increasing number of sOTUs and PD are lost as exposure dose increases

  • at 6 C this pattern is reversed - increasing numbers of sOTUs and PD are gained with increasing exposure dose.

  • at 22 C the change in richness is not correlated with dose for richness but following 14 C for PD

Full Time Series

sOTU Richness

size-scaled by Log Bsal load

Conclusion: : Main Effect of Exposure, Temperature and Time

Contemplation: Model each temperature separately?

sOTU Richness

Only exposed treatment post exposure; size-scaled by Log Bsal load

Phylogenetic Diversity

size-scaled by Log Bsal load

Phylogenetic Diversity

Only exposed treatment; size-scaled by Log Bsal load

Shannon Diversity

size-scaled by Log Bsal load

Shannon Diversity

Only exposed treatment; size-scaled by Log Bsal load

Evenness

size-scaled by Log Bsal load

Evenness

Only exposed treatment; size-scaled by Log Bsal load

Predicted Function

Pre/Post Exposure

Antifungal Richness

Antifungal Function from corrected unrarified data

Antifungal Function

proportionalized through total corrected “abundance” estimate

Antifungal function of between pre/post exposure: 6 C

Antifungal function of between pre/post exposure: 14 C

Antifungal function of between pre/post exposure: 22 C

Beta Diversity

Pre/Post

Temperature 6 C

Temperature 14 C

Temperature 22

PairwiseData_16S_T14Conab <- adegenet::pairDist(AdNewt_unWUF16Smx_14t0t1Conb,Meta16S_14_t1t2_Con$TimeWeekCat, within = FALSE)

PairwiseData_16S_T14Conab2 <- PairwiseData_16S_T14Conab$data %>%
  add_column(Temperature = "14")%>%
  add_column(Dose= "Control")

## 3 dose

Meta16S_14_t1t2_3 <- AdNewt16S_Meta_Alpha_AntiF %>%
  filter(Temperature == 14) %>%
  filter(TimeWeekCat== "A"|TimeWeekCat=="B") %>%
  filter(Dose=="5x10.3")%>%
  drop_na(observed_features)
  
metaList_14t1t2_3<-as.vector(Meta16S_14_t1t2_3$SampleID)

AdNewt_unWUF16Smx_14t0t13 <- usedist::dist_subset(AdNewt_unWUF16Smx2,metaList_14t1t2_3)
AdNewt_unWUF16Smx_14t0t13b <-as.matrix(AdNewt_unWUF16Smx_14t0t13)



PairwiseData_16S_T143ab <- adegenet::pairDist(AdNewt_unWUF16Smx_14t0t13b,Meta16S_14_t1t2_3$TimeWeekCat, within = FALSE)

PairwiseData_16S_T143ab2 <- PairwiseData_16S_T143ab$data %>%
  add_column(Temperature = "14")%>%
  add_column(Dose= "5x10.3")

## 4 
Meta16S_14_t1t2_4 <- AdNewt16S_Meta_Alpha_AntiF %>%
  filter(Temperature == 14) %>%
  filter(TimeWeekCat== "A"|TimeWeekCat=="B") %>%
  filter(Dose=="5x10.4")%>%
  drop_na(observed_features)
  
metaList_14t1t2_4<-as.vector(Meta16S_14_t1t2_4$SampleID)

AdNewt_unWUF16Smx_14t0t14 <- usedist::dist_subset(AdNewt_unWUF16Smx2,metaList_14t1t2_4)
AdNewt_unWUF16Smx_14t0t14b <-as.matrix(AdNewt_unWUF16Smx_14t0t14)

PairwiseData_16S_T144ab <- adegenet::pairDist(AdNewt_unWUF16Smx_14t0t14b,Meta16S_14_t1t2_4$TimeWeekCat, within = FALSE)

PairwiseData_16S_T144ab2 <- PairwiseData_16S_T144ab$data %>%
  add_column(Temperature = "14")%>%
  add_column(Dose= "5x10.4")

## 5 
Meta16S_14_t1t2_5 <- AdNewt16S_Meta_Alpha_AntiF %>%
  filter(Temperature == 14) %>%
  filter(TimeWeekCat== "A"|TimeWeekCat=="B") %>%
  filter(Dose=="5x10.5")%>%
  drop_na(observed_features)
  
metaList_14t1t2_5<-as.vector(Meta16S_14_t1t2_5$SampleID)

AdNewt_unWUF16Smx_14t0t15 <- usedist::dist_subset(AdNewt_unWUF16Smx2,metaList_14t1t2_5)
AdNewt_unWUF16Smx_14t0t15b <-as.matrix(AdNewt_unWUF16Smx_14t0t15)

PairwiseData_16S_T145ab <- adegenet::pairDist(AdNewt_unWUF16Smx_14t0t15b,Meta16S_14_t1t2_5$TimeWeekCat, within = FALSE)

PairwiseData_16S_T145ab2 <- PairwiseData_16S_T145ab$data %>%
  add_column(Temperature = "14")%>%
  add_column(Dose= "5x10.5")

## 6
Meta16S_14_t1t2_6 <- AdNewt16S_Meta_Alpha_AntiF %>%
  filter(Temperature == 14) %>%
  filter(TimeWeekCat== "A"|TimeWeekCat=="B") %>%
  filter(Dose=="5x10.6")%>%
  drop_na(observed_features)
  
metaList_14t1t2_6<-as.vector(Meta16S_14_t1t2_6$SampleID)

AdNewt_unWUF16Smx_14t0t16 <- usedist::dist_subset(AdNewt_unWUF16Smx2,metaList_14t1t2_6)
AdNewt_unWUF16Smx_14t0t16b <-as.matrix(AdNewt_unWUF16Smx_14t0t16)

PairwiseData_16S_T146ab <- adegenet::pairDist(AdNewt_unWUF16Smx_14t0t16b,Meta16S_14_t1t2_6$TimeWeekCat, within = FALSE)

PairwiseData_16S_T146ab2 <- PairwiseData_16S_T146ab$data %>%
  add_column(Temperature = "14")%>%
  add_column(Dose= "5x10.6")

Pairwise_14_Compile = rbind(PairwiseData_16S_T14Conab2,PairwiseData_16S_T143ab2,PairwiseData_16S_T144ab2,PairwiseData_16S_T145ab2,PairwiseData_16S_T146ab2)

Pairwise_14_Compile  %>%
  left_join(.,DoseNumData) %>%
  ggplot(aes(x = as.numeric(DoseNum),y = distance))+
  geom_point()+ 
  geom_smooth(method=lm, level = 0.95)+ stat_cor(method = "kendall", label.sep='\n') +
  ggtitle("Pairwise distance between t0 and t1 across doses")+
  xlab("Dose")

Time Series

Temperature 6 - through time

Temperature 14 - through time

Temperature 22 - through time

Final timepoint

Taxa

Temp 6 - Week 7

Last week of “good” sample size of both groups

Temp 6 - Post exposure across doses

Temp 14 - Week 4

Last week of “good” sample size of both groups

Temp 14 - Post exposure across doses

Temp 22 - Week 8

Last week of “good” sample size of both groups

Temp 22 - Post exposure across doses

Differential

QIIME details

### Filtering to Temp 14 and Controls and 10^3 samples

Mollys-MacBook-Pro-2:~ mollybletz$ qiime feature-table filter-samples --i-table /Users/mollybletz/My_FILES/EEID_NSF_Microbiomes/EEID_AqAdult_TempDose_Exp/16S/WithPlasmid/PlasmidWork_contamfilt_samplefilt_OTU-table_wplasmid_EEID_AqAdult_merged1234/Filtlowsamp_CopCor_True_abund_estimate_contamfilt_samplefilt_OTU-table_wplasmid_EEID_AqAdult_TempDose_Exp_merged1234.qza --m-metadata-file /Users/mollybletz/My_FILES/EEID_NSF_Microbiomes/EEID_AqAdult_TempDose_Exp/16S/Metadata_NSFEEID_16SRuns_1234Merged_plusExpData.txt --p-where "[Temperature]='14' AND [Dose] IN ('Control','5x10.3')" --o-filtered-table /Users/mollybletz/My_FILES/EEID_NSF_Microbiomes/EEID_AqAdult_TempDose_Exp/16S/WithPlasmid/PlasmidWork_contamfilt_samplefilt_OTU-table_wplasmid_EEID_AqAdult_merged1234/Temp14-TS_Filtlowsamp_CopCor_True_abund_estimate_contamfilt_samplefilt_OTU-table_wplasmid_EEID_AqAdult_TempDose_Exp_merged1234.qza --p-no-exclude-ids

### Filtering to OTUs with a cumulative frequency of 100 reads

(qiime2-2020.8) Mollys-MacBook-Pro-2:~ mollybletz$ qiime feature-table filter-features --i-table /Users/mollybletz/My_FILES/EEID_NSF_Microbiomes/EEID_AqAdult_TempDose_Exp/16S/WithPlasmid/PlasmidWork_contamfilt_samplefilt_OTU-table_wplasmid_EEID_AqAdult_merged1234/Temp14-TS_Filtlowsamp_CopCor_True_abund_estimate_contamfilt_samplefilt_OTU-table_wplasmid_EEID_AqAdult_TempDose_Exp_merged1234.qza --p-min-frequency 100 --o-filtered-table /Users/mollybletz/My_FILES/EEID_NSF_Microbiomes/EEID_AqAdult_TempDose_Exp/16S/WithPlasmid/PlasmidWork_contamfilt_samplefilt_OTU-table_wplasmid_EEID_AqAdult_merged1234/Temp14-TS__min100_Filtlowsamp_CopCor_True_abund_estimate_contamfilt_samplefilt_OTU-table_wplasmid_EEID_AqAdult_TempDose_Exp_merged1234.qza 

###calculating Core features to deetermine threshold

(qiime2-2020.8) Mollys-MacBook-Pro-2:PlasmidWork_contamfilt_samplefilt_OTU-table_wplasmid_EEID_AqAdult_merged1234 mollybletz$ qiime feature-table core-features --i-table /Users/mollybletz/My_FILES/EEID_NSF_Microbiomes/EEID_AqAdult_TempDose_Exp/16S/WithPlasmid/PlasmidWork_contamfilt_samplefilt_OTU-table_wplasmid_EEID_AqAdult_merged1234/Temp14-TS__min100_Filtlowsamp_CopCor_True_abund_estimate_contamfilt_samplefilt_OTU-table_wplasmid_EEID_AqAdult_TempDose_Exp_merged1234.qza --o-visualization Temp14_TS_min100_CoreFeatures.qzv

### Filtering  to OTUs present in at least 20 samples (out of 80 in dataset)

(qiime2-2020.8) Mollys-MacBook-Pro-2:PlasmidWork_contamfilt_samplefilt_OTU-table_wplasmid_EEID_AqAdult_merged1234 mollybletz$ qiime feature-table filter-features --i-table /Users/mollybletz/My_FILES/EEID_NSF_Microbiomes/EEID_AqAdult_TempDose_Exp/16S/WithPlasmid/PlasmidWork_contamfilt_samplefilt_OTU-table_wplasmid_EEID_AqAdult_merged1234/Temp14-TS__min100_Filtlowsamp_CopCor_True_abund_estimate_contamfilt_samplefilt_OTU-table_wplasmid_EEID_AqAdult_TempDose_Exp_merged1234.qza --p-min-samples 20 --o-filtered-table /Users/mollybletz/My_FILES/EEID_NSF_Microbiomes/EEID_AqAdult_TempDose_Exp/16S/WithPlasmid/PlasmidWork_contamfilt_samplefilt_OTU-table_wplasmid_EEID_AqAdult_merged1234/Temp14-TS_samp20_min100_Filtlowsamp_CopCor_True_abund_estimate_contamfilt_samplefilt_OTU-table_wplasmid_EEID_AqAdult_TempDose_Exp_merged1234.qza 

Running PCA to identify OTUs that were varying the most across multiple time-points (idea being to reduce the number of OTUS in the mix)

Ploting OTUs through time

modeling explorations

## Generalized linear mixed model fit by maximum likelihood (Laplace
##   Approximation) [glmerMod]
##  Family: poisson  ( log )
## Formula: ceiling(abundance) ~ TimeWeek + Dose + TimeWeek * Dose + (1 |  
##     IndividualID)
##    Data: T14_TS_minS20_minr100_1_4_PCAotus_tr_meta_OTU1
## 
##       AIC       BIC    logLik  deviance  df.resid 
##  803582.8  803593.7 -401786.4  803572.8        60 
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -178.47  -44.66  -21.62   -0.03  543.75 
## 
## Random effects:
##  Groups       Name        Variance Std.Dev.
##  IndividualID (Intercept) 5.923    2.434   
## Number of obs: 65, groups:  IndividualID, 15
## 
## Fixed effects:
##                     Estimate Std. Error z value Pr(>|z|)    
## (Intercept)         5.698736   1.033208   5.516 3.48e-08 ***
## TimeWeek            0.350731   0.002343 149.690  < 2e-16 ***
## Dose5x10.3          0.938237   1.268220   0.740    0.459    
## TimeWeek:Dose5x10.3 0.005062   0.002627   1.927    0.054 .  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) TimeWk D510.3
## TimeWeek    -0.006              
## Dose5x10.3  -0.800  0.005       
## TmWk:D510.3  0.005 -0.892 -0.005
## convergence code: 0
## Model is nearly unidentifiable: very large eigenvalue
##  - Rescale variables?
## Model is nearly unidentifiable: large eigenvalue ratio
##  - Rescale variables?

## Generalized linear mixed model fit by maximum likelihood (Laplace
##   Approximation) [glmerMod]
##  Family: poisson  ( log )
## Formula: ceiling(abundance) ~ TimeWeek + Dose + TimeWeek * Dose + (1 |  
##     IndividualID)
##    Data: T14_TS_minS20_minr100_1_4_PCAotus_tr_meta_OTU2
## 
##      AIC      BIC   logLik deviance df.resid 
## 114033.7 114044.6 -57011.9 114023.7       60 
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -137.165   -3.126   -0.552    0.469  214.336 
## 
## Random effects:
##  Groups       Name        Variance Std.Dev.
##  IndividualID (Intercept) 6.302    2.51    
## Number of obs: 65, groups:  IndividualID, 15
## 
## Fixed effects:
##                     Estimate Std. Error z value Pr(>|z|)    
## (Intercept)          0.50649    1.14347   0.443   0.6578    
## TimeWeek             0.22683    0.05620   4.036 5.44e-05 ***
## Dose5x10.3           2.46395    1.39398   1.768   0.0771 .  
## TimeWeek:Dose5x10.3  0.02575    0.05628   0.458   0.6473    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) TimeWk D510.3
## TimeWeek    -0.129              
## Dose5x10.3  -0.820  0.106       
## TmWk:D510.3  0.129 -0.999 -0.106

ALL otus not PCA filtered